// 回款池相关接口
import request from '@/utils/request'
import { withPrefix, Method } from '@/service/index'

// 回款池列表
export const cashBackPollList = (data) => {
  return request({
    url: withPrefix('/api/finance/transactionFlowInfo/v1/list'),
    method: Method.POST,
    data
  })
}

// 编辑收款流水
export const editCashBack = (data) => {
  return request({
    url: withPrefix('/api/finance/transactionFlowInfo/v1/update'),
    method: Method.POST,
    data
  })
}

// 认领记录
export const claimList = (data) => {
  return request({
    url: withPrefix('/api/finance/claimRecord/v1/queryPage'),
    method: Method.POST,
    data
  })
}

// 导入银行流水
export const importFlow = data => {
  return request({
    url: withPrefix('/api/finance/transactionFlowInfo/v1/import'),
    method: Method.POST,
    data
  })
}

// 回款池编辑弹窗中收款主体列表
export const payeeAccountList = data => {
  return request({
    url: withPrefix('/api/finance/payeeAccount/v1/queryList'),
    method: Method.POST,
    data
  })
}

// 回款池编辑弹窗中收款主体银行列表
export const payeeBankList = data => {
  return request({
    url: withPrefix('/api/finance/payeeAccountItem/v1/queryList'),
    method: Method.POST,
    data
  })
}

// 回款池编辑弹窗详情接口
export const cashBackDetail = data => {
  return request({
    url: withPrefix('/api/finance/transactionFlowInfo/v1/getEditDetail'),
    method: Method.POST,
    data
  })
}

// 根据汇率获取原币种金额
export const getOriginCurrency = data => {
  return request({
    url: withPrefix('/api/finance/exchangeRate/v1/getOriginalAmountByExchangeRate'),
    method: Method.POST,
    data
  })
}

// 根据汇率获取目标币种金额
export const getTargetCurrency = data => {
  return request({
    url: withPrefix('/api/finance/exchangeRate/v1/getTargetAmountByExchangeRate'),
    method: Method.POST,
    data
  })
}
